package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.en.AccountType;
import com.hengpeng.itfinbase.idAssign.AbstractAssign18IdEntity;

/**
 * <pre>
 * 充值提现表
 * </pre>
 * @author linriqing
 * @version 1.0, 2010-7-19
 */
@Entity
public class Payment extends AbstractAssign18IdEntity
{
	/**
	 * <pre>
	 * 操作类型
	 * </pre>
	 * @author linriqing
	 * @version 1.0, 2010-7-19
	 */
	public static enum PaymentType
	{
		/**
		 * 充值
		 */
		IMPREST("充值"),
		/**
		 * 提现
		 */
		DRAW("提现");

		private String text;

		PaymentType(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	/**
	 * <pre>
	 * 充值或提现处理状态
	 * </pre>
	 * @author linriqing
	 * @version 1.0, 2010-7-19
	 */
	public static enum PayStatus
	{
		PAYING("处理中"), FAILED("处理失败"), SUCCESS("处理成功");

		private String text;

		PayStatus(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	private static final long serialVersionUID = -9008803354355283559L;

	/**
	 * 充值类型
	 */
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "支付类型", labelProperty = "text", type = HtmlInputType.TEXT, index = 1, nullable = true)
	private PaymentType type;

	/**
	 * 用户id
	 */
	@Column(length = 200)
	@HtmlInput(label = "用户ID", type = HtmlInputType.TEXT, index = 2, nullable = true)
	private Long userId;

	/**
	 * 用户姓名
	 */
	@Column(length = 50)
	@HtmlInput(label = "用户名", type = HtmlInputType.TEXT, index = 3, nullable = true)
	private String userName;

	/**
	 * 托管账户id
	 */
	@Column(length = 50)
	@HtmlInput(label = "托管账户id", type = HtmlInputType.TEXT, index = 4, nullable = true)
	private String trustAccountId;

	/**
	 * 账户ID
	 */
	@HtmlInput(label = "账户ID", type = HtmlInputType.TEXT, index = 5, nullable = true)
	private Long accountId;

	/**
	 * 账户类型
	 */
	@HtmlInput(label = "账户类型", labelProperty = "text", type = HtmlInputType.TEXT, index = 6, nullable = true)
	@Column(length = 20)
	@Enumerated(javax.persistence.EnumType.STRING)
	private AccountType accountType;

	/**
	 * 银行名称
	 */
	@Column(length = 50)
	@HtmlInput(label = "银行名称", type = HtmlInputType.TEXT, index = 7, nullable = true)
	private String bankName;

	@HtmlInput(label = "手续费(分)", type = HtmlInputType.TEXT, index = 8, nullable = true)
	private Long chargeMoney = 0L;

	@HtmlInput(label = "金额(分)", type = HtmlInputType.TEXT, index = 9, nullable = false)
	private Long money;

	/**
	 * 订单提交的表单信息
	 */
	@Column(length = 10000)
	@HtmlInput(label = "表单信息", type = HtmlInputType.TEXTAREA, index = 10, nullable = true)
	private String formMsg;

	/**
	 * 订单号
	 */
	@Column(length = 50)
	@HtmlInput(label = "订单号", type = HtmlInputType.TEXT, index = 11, nullable = false)
	private String orderId;

	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "支付处理状态", labelProperty = "text", type = HtmlInputType.TEXT, index = 12, nullable = false)
	private PayStatus status;

	@Column(length = 150)
	@HtmlInput(label = "失败原因", type = HtmlInputType.TEXT, index = 13, nullable = true)
	private String failedMsg;

	@HtmlInput(label = "请求时间", type = HtmlInputType.TEXT, format = "yyyy-MM-dd HH:mm:ss", index = 14, nullable = false)
	private Date requestTime;

	@HtmlInput(label = "完成时间", type = HtmlInputType.TEXT, format = "yyyy-MM-dd HH:mm:ss", index = 15, nullable = false)
	private Date overTime;

	@HtmlInput(label = "对账时间", type = HtmlInputType.TEXT, format = "yyyy-MM-dd HH:mm:ss", index = 16, nullable = false)
	private Date reconcilTime;

	@Column(length = 10)
	@HtmlInput(label = "支付服务商", type = HtmlInputType.TEXT, index = 17, nullable = true)
	private String providerId;

	@HtmlInput(label = "浏览器版本", type = HtmlInputType.TEXT, index = 18, nullable = true)
	private String userAgent;

	/**
	 * 是否已对账
	 */
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "是否已对账", type = HtmlInputType.TEXT, labelProperty = "text", index = 19, nullable = true)
	private BoolValue isReconcil;

	@HtmlInput(label = "创建时间", type = HtmlInputType.TEXT, format = "yyyy-MM-dd HH:mm:ss", index = 20, nullable = true)
	private Date createTime;

	@HtmlInput(label = "更新时间", type = HtmlInputType.TEXT, format = "yyyy-MM-dd HH:mm:ss", index = 21, nullable = true)
	private Date updateTime;

	/**
	 * 商户号
	 */
	private String merchantId;

	public String getMerchantId()
	{
		return merchantId;
	}

	public void setMerchantId(String merchantId)
	{
		this.merchantId = merchantId;
	}

	public Long getUserId()
	{
		return userId;
	}

	public void setUserId(Long userId)
	{
		this.userId = userId;
	}

	public String getUserName()
	{
		return userName;
	}

	public void setUserName(String userName)
	{
		this.userName = userName;
	}

	public String getTrustAccountId()
	{
		return trustAccountId;
	}

	public void setTrustAccountId(String trustAccountId)
	{
		this.trustAccountId = trustAccountId;
	}

	public String getBankName()
	{
		return bankName;
	}

	public void setBankName(String bankName)
	{
		this.bankName = bankName;
	}

	public Long getChargeMoney()
	{
		return chargeMoney;
	}

	public void setChargeMoney(Long chargeMoney)
	{
		this.chargeMoney = chargeMoney;
	}

	public Long getMoney()
	{
		return money;
	}

	public void setMoney(Long money)
	{
		this.money = money;
	}

	public String getFormMsg()
	{
		return formMsg;
	}

	public void setFormMsg(String formMsg)
	{
		this.formMsg = formMsg;
	}

	public String getOrderId()
	{
		return orderId;
	}

	public void setOrderId(String orderId)
	{
		this.orderId = orderId;
	}

	public PayStatus getStatus()
	{
		return status;
	}

	public void setStatus(PayStatus status)
	{
		this.status = status;
	}

	public String getFailedMsg()
	{
		return failedMsg;
	}

	public void setFailedMsg(String failedMsg)
	{
		this.failedMsg = failedMsg;
	}

	public Date getRequestTime()
	{
		return requestTime;
	}

	public void setRequestTime(Date requestTime)
	{
		this.requestTime = requestTime;
	}

	public Date getOverTime()
	{
		return overTime;
	}

	public void setOverTime(Date overTime)
	{
		this.overTime = overTime;
	}

	public Date getReconcilTime()
	{
		return reconcilTime;
	}

	public void setReconcilTime(Date reconcilTime)
	{
		this.reconcilTime = reconcilTime;
	}

	public String getProviderId()
	{
		return providerId;
	}

	public void setProviderId(String providerId)
	{
		this.providerId = providerId;
	}

	public String getUserAgent()
	{
		return userAgent;
	}

	public void setUserAgent(String userAgent)
	{
		this.userAgent = userAgent;
	}

	public BoolValue getIsReconcil()
	{
		return isReconcil;
	}

	public void setIsReconcil(BoolValue isReconcil)
	{
		this.isReconcil = isReconcil;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Long getAccountId()
	{
		return accountId;
	}

	public void setAccountId(Long accountId)
	{
		this.accountId = accountId;
	}

	public AccountType getAccountType()
	{
		return accountType;
	}

	public void setAccountType(AccountType accountType)
	{
		this.accountType = accountType;
	}

	public PaymentType getType()
	{
		return type;
	}

	public void setType(PaymentType type)
	{
		this.type = type;
	}

}